<?php
$dis_id=2;
include("../../inc/conn.inc");
include("../islogin.php");

$check_rs=@mysql_query("select id,m_type,m_jifen from member where id='".$_COOKIE['user_id']."'");
$check_row=@mysql_fetch_array($check_rs);

if($_POST[act]){

	if($check_row[m_type]==3){
		/*
         if($check_row[m_jifen]>2){
		 $jifen=$check_row[m_jifen]-3;
         mysql_query("update member set c_logo='$_POST[picture]',m_jifen='$jifen',m_cl='0' where id='".$_COOKIE['user_id']."'");
		 mysql_query("insert into jifen (member_id,j_type,j_num,j_name,add_time) values ('".$_COOKIE['user_id']."','1','3','上传企业LOGO','".date("Y-m-d H:i:s")."')");
		 
		 echo "<script>alert('提交成功');location='logo.php';</script>";
		 }else{
		 
		 echo "<script>alert('您的三帝币余额不足，请充值三帝币');location='logo.php';</script>";
		 }*/
		echo "<script>alert('此功能只对钻石会员开放');location='logo.php';</script>";  
	}
  if($check_row[m_type]==6){	 
		 mysql_query("update member set c_logo='$_POST[picture]',m_cl='0' where id='".$_COOKIE['user_id']."'");
		 
         echo "<script>alert('提交成功');location='logo.php';</script>";
  }
		
}

?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员中心-三帝贸易网</title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
</head>
<script type="text/javascript" src="../js/left.js"></script>
<body>
<div id="mian">
<?php include("../inc/top.php");?>
<div class="top1"><span>您当前位置：<a href="../index.php" class="dh">会员助手</a> &gt;&gt; 企业网站配置 &gt;&gt; 上传企业LOGO</span></div>
<div class="left">
<?php include("../inc/left.php");?>
</div>
<div class="right">
<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
   <TR>
     <TD height="40" bgcolor="#EFF6FF" style="font-size:18px;font-weight:bold;padding-left:8px;">上传企业LOGO</TD>
   </TR>
</TABLE>
<br>
<font color="#FF0000">注：此功能对钻石会员开放，普通会员上传图片需要3个三帝币/次。</font>
<br>
<br>
<?php
	$rs=mysql_query("select id,c_logo  from member where id='".$_COOKIE['user_id']."'");
	$row=mysql_fetch_array($rs);
	?>
      <TABLE width="100%" border="0" cellPadding="0" cellSpacing="0" bgcolor="#EEEEEE">
        <TR>
          <TD bgcolor="#FFFFFF">
            <TABLE width="100%" border="0" cellpadding="0" cellSpacing="1" bgcolor="#C1DCF5">
              <TBODY> <form method="post" action="" name="form1" onSubmit="return checkimg()">
                <TR>
                  <td width="26%" height="30" align="center" bgcolor="#EFF6FF">企业标志</td>
                  <TD width="74%" bgcolor="#F9F9F9" style="padding-left:3px;">
				  <?php if($row[c_logo]){
				  ?><img src="/upfile/<?=$row[c_logo]?>" border="0" <?=imgstr("http://www.sandib2b.cn/upfile/$row[c_logo]","242","60")?>/><br /><?php }?><input name="picture" type="text" size="35" value="<?=$row[c_logo]?>">&nbsp;&nbsp;<input name="button" type="button" onClick="window.open ('../upfile.php', 'newwindow', 'height=50, width=400, top=250, left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')" value="上传图片">
				  (<font color="#FF0000">图片限制242*60</font>)</TD>
                </TR>
                <TR>
                  <td height="30" align="center" bgcolor="#EFF6FF">&nbsp;</td>
                  <TD bgcolor="#F9F9F9"><input type="submit" value=" 提 交 ">
                  <input type="hidden" name="act" value="ok"></TD>
                </TR></form>
              </TBODY>
          </TABLE></TD>
        </TR>
      </TABLE>
</div>
<div class="onl"></div>
<?php include("../inc/foot.php");?>
</div>
</body>
</html>

<script language="javascript">
function $(id){
return document.getElementById(id);
}
function checkimg(){
if($("picture").value==""){
alert("请上传图片");
$("picture").focus();
return false;
}
}
</script>
